package com.jichangxiu.server.platform.entity.po;

import com.baomidou.mybatisplus.annotation.*;
import com.jichangxiu.common.entity.po.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.List;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("platform_role")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@Schema(description = "角色实体")
public class PlatformRole extends BaseEntity implements Serializable {

    @Schema(description = "角色ID")
    @TableId(value = "role_id", type = IdType.ASSIGN_UUID)
    private String roleId;

    @TableField("role_no")
    @Schema(description = "角色编码")
    private String roleNo;

    @TableField("role_code")
    @Schema(description = "角色标识")
    private String roleCode;

    @TableField("role_name")
    @Schema(description = "角色名称")
    private String roleName;

    @TableField("data_scope")
    @Schema(description = "数据范围（1：全部数据权限 2：自定数据权限 3：本部门数据权限 4：本部门及以下数据权限）")
    private String dataScope;

    @TableField("tenant_id")
    @Schema(description = "租户ID")
    private String tenantId;

    @TableField("remark")
    @Schema(description = "备注")
    private String remark;

    @TableField("status")
    @Schema(description = "状态（false停用 true正常）")
    private Boolean status;

    @Schema(description = "显示顺序")
    @TableField(value = "sort", keepGlobalFormat = true)
    private Double sort;

    @TableLogic
    @TableField("deleted")
    @Schema(description = "是否删除（0否 1是）")
    private String deleted;

    @TableField(exist = false)
    @Schema(description = "用户角色列表")
    private List<PlatformUserRole> platformUserRoles;

    @TableField(exist = false)
    @Schema(description = "角色菜单列表")
    private List<PlatformRoleMenu> platformRoleMenus;

    @TableField(exist = false)
    @Schema(description = "部门角色列表")
    private List<PlatformDeptRole> platformDeptRoles;


}
